import BuffUtil from '@/BuffUtil';
import UnitSpellEvent from '@/event/UnitSpellEvent';
import ItemUtil from '@/ItemUtil';
export default class Item_刃甲 {
    static id = 'AIpv';
    static 名称: string = '刃甲';
    static 描述: string = '强化反射，反射伤害增加200%';
    static 图标: string = 'assets\\item\\INV_Chest_Plate08.blp';
    static buffId: string = 'buff_item_renjia';
    static buffType: AppBuffType = {
        id: 'buff_item_renjia',
        name: Item_刃甲.名称,
        ubertip: Item_刃甲.描述,
        art: Item_刃甲.图标,
        attribute: {
            反射伤害倍率: 2,
        },
        targetArt: 'Abilities\\Spells\\Undead\\ThornyShield\\ThornyShieldTargetChestMountRight.mdl',
        targetAttach: 'chest',
        dur: 5,
    };
    static 添加技能(目标: unit) {
        UnitAddAbility(目标, Item_刃甲.id);
    }
    static 释放(x: number, y: number, 来源?: unit, 目标?: unit, d?: any) {
        BuffUtil.addBuff(来源, Item_刃甲.buffId, 来源);
    }
    constructor() {
        BuffUtil.registerBuffType(Item_刃甲.buffType);
        se.onUnitSpellEffect(Item_刃甲.spellEffect, Item_刃甲.id);
        EventManager.onTakeDamage(Item_刃甲.受到伤害处理);
    }
    static 受到伤害处理(d: DamageEventData) {
        if (d.isReflect) return;
        if (!ItemUtil.isUnitHasItem(d.target, 'gopr')) return;
        let dmg = 20 + d.lastDamage * 0.25;
        DamageSystemInstance.applyReflectDamage(d.source, d.target, dmg);
    }
    static spellEffect(this: void, d: UnitSpellEvent) {
        Item_刃甲.释放(d.spellTargetX, d.spellTargetY, d.trigUnit, d.spellTargetUnit, d);
    }
}
